package com.work.biz.service.impl;

import java.util.List;

import com.work.biz.domain.BizWorkDetailVo;
import com.work.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.work.biz.mapper.BizWorkDetailMapper;
import com.work.biz.domain.BizWorkDetail;
import com.work.biz.service.IBizWorkDetailService;

/**
 * 作业完成明细Service业务层处理
 *
 * @author lee
 * @date 2021-04-22
 */
@Service
public class BizWorkDetailServiceImpl implements IBizWorkDetailService {
    @Autowired
    private BizWorkDetailMapper bizWorkDetailMapper;

    /**
     * 查询作业完成明细
     *
     * @param detailId 作业完成明细ID
     * @return 作业完成明细
     */
    @Override
    public BizWorkDetail selectBizWorkDetailById(Long detailId) {
        return bizWorkDetailMapper.selectBizWorkDetailById(detailId);
    }

    /**
     * 查询作业完成明细列表
     *
     * @param bizWorkDetail 作业完成明细
     * @return 作业完成明细
     */
    @Override
    public List<BizWorkDetailVo> selectBizWorkDetailList(BizWorkDetail bizWorkDetail) {
        return bizWorkDetailMapper.selectBizWorkDetailList(bizWorkDetail);
    }

    /**
     * 新增作业完成明细
     *
     * @param bizWorkDetail 作业完成明细
     * @return 结果
     */
    @Override
    public int insertBizWorkDetail(BizWorkDetail bizWorkDetail) {
        bizWorkDetail.setCreateTime(DateUtils.getNowDate());
        return bizWorkDetailMapper.insertBizWorkDetail(bizWorkDetail);
    }

    /**
     * 修改作业完成明细
     *
     * @param bizWorkDetail 作业完成明细
     * @return 结果
     */
    @Override
    public int updateBizWorkDetail(BizWorkDetail bizWorkDetail) {
        bizWorkDetail.setUpdateTime(DateUtils.getNowDate());
        return bizWorkDetailMapper.updateBizWorkDetail(bizWorkDetail);
    }

    /**
     * 批量删除作业完成明细
     *
     * @param detailIds 需要删除的作业完成明细ID
     * @return 结果
     */
    @Override
    public int deleteBizWorkDetailByIds(Long[] detailIds) {
        return bizWorkDetailMapper.deleteBizWorkDetailByIds(detailIds);
    }

    /**
     * 删除作业完成明细信息
     *
     * @param detailId 作业完成明细ID
     * @return 结果
     */
    @Override
    public int deleteBizWorkDetailById(Long detailId) {
        return bizWorkDetailMapper.deleteBizWorkDetailById(detailId);
    }
}
